// crm_orb_tester.cpp : Defines the entry point for the console application.
//

#include <Ice/Ice.h>
#include "Integration.h"

using namespace std;
using namespace CustomerRelationsManagement;


int main(int argc, CHAR* argv[])
{
    int status = 0;
    Ice::CommunicatorPtr ic;
    try {
        ic = Ice::initialize(argc, argv);
        Ice::ObjectPrx base = ic->stringToProxy(
                                "CRM:default -p 31337");
        CRMPrx crm = CRMPrx::checkedCast(base);
        if (!crm)
            throw "Invalid proxy";

		customerPrx cust = crm->CreateCustomer();
		cust->setName("foobar!");
		cust->save();
    } catch (const Ice::Exception& ex) {
        cerr << ex << endl;
        status = 1;
    } catch (const char* msg) {
        cerr << msg << endl;
        status = 1;
    }
    if (ic)
        ic->destroy();
    return status;
}

